home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / pcr / pcr4_4.lha / DIST / boot / XRDBX.csh < prev   
Linux/UNIX/POSIX Shell Script  |  1990-11-12  |  2KB  |  67 lines

  1. #!/bin/csh -f
  2. #
  3. # This is the generic script for invoking the dbx debugger on a
  4. # PCR world.  It normally takes no arguments, but instead 'sources'
  5. # additional commands it needs from a file in the current directory
  6. # called XRDBXInner.  If the environment variable XR_XRDBX_Source
  7. # is defined it will source from there instead.  This script takes
  8. # a single optional argument, which is the name of a core file to
  9. # be analyzed instead of the default pid.
  10. #
  11. # -mdw 10/26/89
  12.  
  13. # Get additional info
  14. if ($?XR_XRDBX_Source == 0) then
  15.     source XRDBXInner
  16. else
  17.     source ${XR_XRDBX_Source}
  18. endif
  19.  
  20. # Make sure we got what we needed from the file.
  21. if ($?core == 0) then
  22.     echo "Variable 'core' was not defined, aborting."
  23.     exit 1
  24. endif
  25. if ($?model == 0) then
  26.     echo "Variable 'model' was not defined, aborting."
  27.     exit 1
  28. endif
  29. if ($1 != "") then
  30.     set core = $1
  31. endif
  32.  
  33. # Make sure the necessary environment is around, else use defaults.
  34. if ( $?XR_HOME == 0 ) then
  35.     setenv XR_HOME /net/palain/jaune/xrhome
  36. endif
  37. if ( $?XR_CONFIG == 0 ) then
  38.     setenv XR_CONFIG Threads
  39. endif
  40. if ( $?XR_VERSION == 0 ) then
  41.     setenv XR_VERSION INSTALLED
  42. endif
  43. if ( $?XR_MACH == 0 ) then
  44.     setenv XR_MACH `mach`
  45. endif
  46. if ( $?XR_DBX == 0 ) then
  47.     setenv XR_DBX dbx
  48. endif
  49.  
  50. # Try for a source version
  51. if ($?XR_SRCVERSION == 0) then
  52.     setenv XR_SRCVERSION ${XR_HOME}/${XR_VERSION}/SRC
  53. endif    
  54.  
  55. # Finally, down to real work.
  56. echo Debugging with symbols from file ${model}, source in ${XR_SRCVERSION}, and state in ${core}.
  57. cp $model $model.dbx
  58. echo -n Transforming symtab file ... 
  59. ${XR_HOME}/${XR_VERSION}/BIN/${XR_CONFIG}-${XR_MACH}/transform_symtab $model.dbx
  60. if ($1 != "") then
  61.     ${XR_HOME}/${XR_VERSION}/BIN/${XR_CONFIG}-${XR_MACH}/fixcore $1 $model.dbx
  62. endif
  63.  
  64. echo done.
  65.  
  66. exec ${XR_DBX} -I. -I${XR_SRCVERSION} $model.dbx $core
  67.